#include "algo_camera.h"
#include <jni.h>
#include <android/log.h>


void get_config(information * resultat_test,JNIEnv* env, jobject thiz){
  int i;
  jclass cls = (*env)->GetObjectClass(env, thiz);
  jmethodID mid = (*env)->GetMethodID(env, cls, "get_config_param_threshold", "(II)I");
  if (mid == 0){
    __android_log_print(ANDROID_LOG_ERROR, "config_traitement.c", "Error when getting the get_config_param_threshold function");
  }

  // ** Definition des seuils ** 
  // * Mets des valeurs dans les seuils *
  for (i=0;i<NB_SEUILS;i++){
    resultat_test->seuils[i].actif=(*env)->CallIntMethod(env, thiz,mid,i,0);
    resultat_test->seuils[i].mode=(*env)->CallIntMethod(env, thiz,mid,i,1);
    resultat_test->seuils[i].H=(*env)->CallIntMethod(env, thiz,mid,i,2);
    resultat_test->seuils[i].Y=(*env)->CallIntMethod(env, thiz,mid,i,3);
    resultat_test->seuils[i].or_avec=(*env)->CallIntMethod(env, thiz,mid,i,4);
    resultat_test->seuils[i].and_avec=(*env)->CallIntMethod(env, thiz,mid,i,5);
    resultat_test->seuils[i].utilise_zones=(*env)->CallIntMethod(env, thiz,mid,i,6);
    resultat_test->seuils[i].z_larg_min=(*env)->CallIntMethod(env, thiz,mid,i,7);
    resultat_test->seuils[i].z_haut_min=(*env)->CallIntMethod(env, thiz,mid,i,8);
    resultat_test->seuils[i].z_larg_max=(*env)->CallIntMethod(env, thiz,mid,i,9);
    resultat_test->seuils[i].z_haut_max=(*env)->CallIntMethod(env, thiz,mid,i,10);
    resultat_test->seuils[i].z_x_min=(*env)->CallIntMethod(env, thiz,mid,i,11);
    resultat_test->seuils[i].z_y_min=(*env)->CallIntMethod(env, thiz,mid,i,12);
    resultat_test->seuils[i].z_x_max=(*env)->CallIntMethod(env, thiz,mid,i,13);
    resultat_test->seuils[i].z_y_max=(*env)->CallIntMethod(env, thiz,mid,i,14);
  }
}


